﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TpBaseObjects.Base {
    public class TpMenu {

        #region Members

        private List<TpMenuGroup> myGroups;
        
        #endregion

        #region Constructor

        public TpMenu() {
            myGroups = new List<TpMenuGroup>();
        }

        
        #endregion

        #region Properties

        public int GroupCount {
            get { return myGroups.Count; }
        }

        public List<TpMenuGroup> MyGroups {
            get { return myGroups; }
        }
                
        #endregion

        #region Functions
        
        public string GetMyGroupName(int index) {
            return myGroups[index].GroupName;
        }

        #endregion

        #region Functions

        public int GetMyGroupIndex(string groupName) {
            foreach (TpMenuGroup menu in myGroups) {
                if (menu.GroupName == groupName) {
                    return menu.MyIndex;
                }
            }
            return 0;
        }

        #endregion

        #region Methods

        public void AddGroup(TpMenuGroup group) {
            myGroups.Add(group);
        }

        #endregion

    }
}
